{template order_header.html}

<div class="row">
    <div class="col-md-12">
        <div class="portlet  portlet-fit ">
            <div class="portlet-body">

                <div class="portlet-title">
                    <div class="caption dr_info">
                        <p>订单号：<a href="javascript:;" class="btn green btn-xs">{$order.sn}</a></p>
                        {dr_order_member_option($member.uid, $order)}
                    </div>

                </div>

                <div class="row" style="clear: both">
                    <div class="col-md-6 col-sm-12">
                        <div class="portlet yellow-crusta box">
                            <div class="portlet-title">
                                <div class="caption"><i class="fa fa-shopping-cart"></i> 订单信息 </div>
                            </div>
                            <div class="portlet-body">
                                <div class="row static-info">
                                    <div class="col-md-5 name">订单状态：</div>
                                    <div class="col-md-7 value"> {dr_order_status($order)}</div>
                                </div>
                                <div class="row static-info">
                                    <div class="col-md-5 name"> 下单时间：</div>
                                    <div class="col-md-7 value"> {dr_date($order.order_time)} </div>
                                </div>
                                {if $member.uid != $order.buy_uid}
                                <div class="row static-info">
                                    <div class="col-md-5 name"> 买家账号：</div>
                                    <div class="col-md-7 value"> {$order.buy_username}  </div>
                                </div>
                                {/if}
                                {if $member.uid != $order.sell_uid}
                                <div class="row static-info">
                                    <div class="col-md-5 name"> 商家账号：</div>
                                    <div class="col-md-7 value"> {$order.sell_username} </div>
                                </div>
                                {/if}
                            </div>
                        </div>
                    </div>
                    <div class="col-md-6 col-sm-12">
                        <div class="portlet blue-hoki box">
                            <div class="portlet-title">
                                <div class="caption">
                                    <i class="fa fa-rmb"></i> 支付信息 </div>
                            </div>
                            <div class="portlet-body">
                                <div class="row static-info">
                                    <div class="col-md-5 name"> 订单金额： </div>
                                    <div class="col-md-7 value"> {if $order.order_score}{intval($order.order_price)}{SITE_SCORE}{else}¥{number_format($order.order_price, 2)}元 {/if}</div>
                                </div>
                                <div class="row static-info">
                                    <div class="col-md-5 name"> 付款时间： </div>
                                    <div class="col-md-7 value"> {if $order.pay_time}{dr_date($order.pay_time)}{else}未付款{/if} </div>
                                </div>
                                <div class="row static-info">
                                    <div class="col-md-5 name"> 支付方式： </div>
                                    <div class="col-md-7 value"> {if $paytype[$order.pay_type]}{$paytype[$order.pay_type]['name']}{else}未知{/if} </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="row">
                    <div class="col-md-6 col-sm-12">
                        <div class="portlet green-meadow box">
                            <div class="portlet-title">
                                <div class="caption">
                                    <i class="fa fa-home"></i> 收货人信息
                                </div>
                            </div>
                            <div class="portlet-body">
                                <div class="row static-info">
                                    <div class="col-md-12 value">
                                        <label>{$order.shipping_name}</label>
                                        <label>{$order.shipping_phone}</label>
                                        <label>{$order.shipping_zipcode}</label>
                                        <label>{$order.shipping_city}{$order.shipping_address}</label>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-6 col-sm-12">
                        <div class="portlet red-sunglo box">
                            <div class="portlet-title">
                                <div class="caption">
                                    <i class="fa fa-bus"></i> 运输信息
                                </div>
                            </div>
                            <div class="portlet-body">
                                <div class="row static-info">
                                    <div class="col-md-5 name"> 发货时间： </div>
                                    <div class="col-md-7 value"> {dr_date($order.shipping_time)} </div>
                                </div>
                                <div class="row static-info">
                                    <div class="col-md-5 name"> 承运者： </div>
                                    <div class="col-md-7 value"> {if $kd[$order.shipping_type]}{$kd[$order.shipping_type]}{else}无{/if} </div>
                                </div>
                                {if $order.shipping_sn}
                                <div class="row static-info">
                                    <div class="col-md-5 name"> 运输单号： </div>
                                    <div class="col-md-7 value"> {$order.shipping_sn} </div>
                                </div>
                                <div class="row static-info">
                                    <div class="col-md-12 value" id="kd_info"> </div>
                                    <script>
                                        $(function(){
                                            $.get("{dr_member_url('order/home/kd')}&name={$order.shipping_type}&sn={$order.shipping_sn}", function(data){
                                                $('#kd_info').html(data);
                                            });
                                        });
                                    </script>
                                </div>
                                {/if}
                            </div>
                        </div>
                    </div>
                </div>


                <div class="row">
                    <div class="col-md-6 col-sm-12">
                        <div class="portlet yellow-haze box">
                            <div class="portlet-title">
                                <div class="caption">
                                    <i class="fa fa-user"></i> 买家留言
                                </div>
                            </div>
                            <div class="portlet-body">
                                {if $order.buy_note}
                                {$order.buy_note}
                                {else}
                                无
                                {/if}
                            </div>
                        </div>
                    </div>
                    <div class="col-md-6 col-sm-12">
                        <div class="portlet blue-soft box">
                            <div class="portlet-title">
                                <div class="caption">
                                    <i class="fa fa-file-o"></i> 其他信息
                                </div>
                            </div>
                            <div class="portlet-body">
                                {if $field}
                                    {template "myfield.html"}
                                {else}
                                无
                                {/if}
                            </div>
                        </div>
                    </div>
                </div>

                <div class="row">
                    <div class="col-md-12 col-sm-12">
                        <div class="portlet grey-cascade box">
                            <div class="portlet-title">
                                <div class="caption">
                                    <i class="fa fa-shopping-cart"></i> 商品清单
                                </div>
                            </div>
                            <div class="portlet-body">
                                <div class="table-responsive">
                                    <table class="table table-hover table-bordered table-striped">
                                        <thead>
                                        <tr>
                                            <th class="hidden-480"> 商品Id </th>
                                            <th> 商品名称 </th>
                                            <th> 商品价格 </th>
                                            <th> 购买数量 </th>
                                            <th>  </th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        {loop $order.goods $t}
                                        <tr>
                                            <td class="hidden-480">
                                                <a target="_blank" href="{$t.url}">{$t.cid}</a>
                                            </td>
                                            <td>
                                                <a class="" target="_blank" href="{$t.url}">{$t.title}
                                                    <?php $sku=dr_string2array($t.sku);?>
                                                    {if $sku}
                                                    （{loop $sku $s $u}<span>{$s}：{$u} </span>{/loop} ）
                                                    {/if}
                                                    {if $t.sn}<p>商品编号：{$t.sn}</p>{/if}
                                                </a>
                                            </td>
                                            <td> {if $order.order_score}{intval($t.price)}{SITE_SCORE}{else}¥{number_format($t.price, 2)}{/if}</td>
                                            <td> {$t.quantity} </td>
                                            <td>
                                                <a href="{SITE_URL}index.php?s={MOD_DIR}&mid={$t.mid}&spec={$t.specification}&cid={$t.cid}&num={$t.quantity}" target="_blank" class="btn blue btn-xs"> <i class="fa fa-shopping-cart"></i> 再次购买</a>
                                                {if $comment[$t.id]}
                                                <a href="{SITE_URL}index.php?s={$t.mid}&c=comment&m=index&id={$t.cid}&oid={$order.id}&gid={$t.id}" target="_blank" class="btn green btn-xs"> <i class="fa fa-comments"></i>  商品评论</a> </td>
                                                {/if}
                                        </tr>
                                        {/loop}

                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6"> </div>
                    <div class="col-md-6">
                        <div class="well">
                            <div class="row static-info align-reverse">
                                <div class="col-md-7 name"> 优惠了： </div>
                                <div class="col-md-5 value"> ¥{number_format($order.order_youhui, 2)} 元</div>
                            </div>
                            <div class="row static-info align-reverse">
                                <div class="col-md-7 name"> 运费： </div>
                                <div class="col-md-5 value"> ¥{number_format($order.shipping_price, 2)} 元</div>
                            </div>
                            <div class="row static-info align-reverse">
                                <div class="col-md-7 name"> 应付总额： </div>
                                <div class="col-md-5 value"> {if $order.order_score}{intval($order.order_price)}{SITE_SCORE}{else}¥{number_format($order.order_price, 2)} 元{/if}</div>
                            </div>
                        </div>
                    </div>
                </div>


            </div>
        </div>
        <!-- End: life time stats -->
    </div>
</div>

{template nfooter.html}